import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ListResult } from 'app/modules/base/api-base';
import { SoftwareService, SoftwareInfo } from './software.service';

@Injectable({
	providedIn: 'root',
})
export class ListService implements Resolve<ListResult<SoftwareInfo>> {
	constructor(private softwareService: SoftwareService) {}
	async resolve(route: ActivatedRouteSnapshot) {
		return this.softwareService.list(route.queryParams);
	}
}
